﻿<UserControl x:Class="DepartmentControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
             DataContext="{Binding RelativeSource={RelativeSource Self}}"
             xmlns:lib="clr-namespace:HMSLibrary;assembly=HMSLibrary"
              xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit">
    <Grid Width="400">
        <Grid Name="MainGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="300"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="28"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="28"/>
            </Grid.RowDefinitions>
            <TextBlock Text="Name:" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Watermark="Department name" Name="NameTextBox" Margin="2"/>
            <!--<TextBlock Text="Charges:" Grid.Row="1" Style="{StaticResource TextBlockStyle}"/>
        <extToolkit:WatermarkTextBox Grid.Column="1" Watermark="Charges" Grid.Row="1" Name="ChargesTextBox" Margin="2"/>-->
            <TextBlock Text="Incharge :" Grid.Row="2" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="2" Margin="2" Name="InchargeComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Remarks:" Grid.Row="3" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Watermark="Remarks" Grid.Row="3" Name="RemarksTextBox" Margin="2" AcceptsReturn="True" TextWrapping="WrapWithOverflow" VerticalScrollBarVisibility="Auto"/>

        </Grid>
        <StackPanel Name="FindStackPanel" Visibility="Collapsed">
            <lib:SearchBox x:Name="Ctrl" HorizontalAlignment="Right" Margin="10,5"
					Width="249" Height="22" Mode="{Binding SelectedValue.Content, ElementName=SearchMode}"
					Prompt="Search text" ToolTip="Type to search the current view">
                <lib:SearchBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Option 1" IsCheckable="True"/>
                        <MenuItem Header="Option 2" IsCheckable="True"/>
                    </ContextMenu>
                </lib:SearchBox.ContextMenu>
                <lib:SearchBox.LayoutTransform>
                    <ScaleTransform ScaleX="{Binding Value, ElementName=Scaler}" 
																						ScaleY="{Binding Value, ElementName=Scaler}"/>
                </lib:SearchBox.LayoutTransform>
            </lib:SearchBox>
            <extToolkit:BusyIndicator Name="BusyIndicator1" Grid.ColumnSpan="3"/>
            <ScrollViewer Margin="5" MaxHeight="250">
                <my:DataGrid Grid.Row="2" Name="SearchDataGrid" Style="{StaticResource SerachDataGridStyle}">
                    <my:DataGrid.Columns>
                        <my:DataGridTemplateColumn Width="20">
                            <my:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Template="{StaticResource DeleteButtonTemp}" Name="DeleteButton" Click="DeleteButton_Click"/>
                                </DataTemplate>
                            </my:DataGridTemplateColumn.CellTemplate>
                        </my:DataGridTemplateColumn>
                        <my:DataGridTextColumn Header="Name" Binding="{Binding Name}" />
                        <my:DataGridTextColumn Header="In Charge" Binding="{Binding Incharge}" />
                        <my:DataGridTextColumn Header="Remarks" Binding="{Binding Description}" />
                    </my:DataGrid.Columns>
                </my:DataGrid>
            </ScrollViewer>
        </StackPanel>
    </Grid>
</UserControl>
